'use strict'
// Template version: 1.3.1
// see http://vuejs-templates.github.io/webpack for documentation.

const path = require('path')
// var qs=require('qs');
// var instance = axios.create({
//     headers: {'content-type': 'application/x-www-form-urlencoded'}
// });
module.exports = {
  dev: {
    // Paths
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',
    proxyTable: {
      '/api':{
        // 新闻：/touch/reconstruct/article/list/BBM54PGAwangning/0-10.html
        // 娱乐：/touch/reconstruct/article/list/BA10TA81wangning/0-10.html
        // 体育：/touch/reconstruct/article/list/BA8E6OEOwangning/0-10.html
        // 财经：/touch/reconstruct/article/list/BA8EE5GMwangning/0-10.html
        // 军事：/touch/reconstruct/article/list/BAI67OGGwangning/0-10.html
        // 科技：/touch/reconstruct/article/list/BA8D4A3Rwangning/0-10.html
        // 手机：/touch/reconstruct/article/list/BAI6I0O5wangning/0-10.html
        // 数码：/touch/reconstruct/article/list/BAI6JOD9wangning/0-10.html
        // 时尚：/touch/reconstruct/article/list/BA8F6ICNwangning/0-10.html
        // 游戏：/touch/reconstruct/article/list/BAI6RHDKwangning/0-10.html
        // 教育：/touch/reconstruct/article/list/BA8FF5PRwangning/0-10.html
        // 健康：/touch/reconstruct/article/list/BDC4QSV3wangning/0-10.html
        // 旅游：/touch/reconstruct/article/list/BEO4GINLwangning/0-10.html
        // 视频：/touch/nc/api/video/recommend/Video_Recom/0-10.do?callback=videoList

        target:'https://3g.163.com',      //域名端口
        changeOrigin:true,
        pathRewrite:{
          '^/api':'/'
        }
      }
    },

    // Various Dev Server settings
    host: 'localhost', // can be overwritten by process.env.HOST
    port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
    autoOpenBrowser: false,
    errorOverlay: true,
    notifyOnErrors: true,
    poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-

    
    /**
     * Source Maps
     */

    // https://webpack.js.org/configuration/devtool/#development
    devtool: 'cheap-module-eval-source-map',

    // If you have problems debugging vue-files in devtools,
    // set this to false - it *may* help
    // https://vue-loader.vuejs.org/en/options.html#cachebusting
    cacheBusting: true,

    cssSourceMap: true
  },

  build: {
    // Template for index.html
    index: path.resolve(__dirname, '../dist/index.html'),

    // Paths
    assetsRoot: path.resolve(__dirname, '../dist'),
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',

    /**
     * Source Maps
     */

    productionSourceMap: true,
    // https://webpack.js.org/configuration/devtool/#production
    devtool: '#source-map',

    // Gzip off by default as many popular static hosts such as
    // Surge or Netlify already gzip all static assets for you.
    // Before setting to `true`, make sure to:
    // npm install --save-dev compression-webpack-plugin
    productionGzip: false,
    productionGzipExtensions: ['js', 'css'],

    // Run the build command with an extra argument to
    // View the bundle analyzer report after build finishes:
    // `npm run build --report`
    // Set to `true` or `false` to always turn it on or off
    bundleAnalyzerReport: process.env.npm_config_report
  }
}
